package edu.umd.ion.wavemeter.service;

import com.google.gwt.user.client.rpc.IsSerializable;
import java.util.Vector;

/**
 * Data Class containing the status of the Wavemeter and the current measurements.
 * An object of this class is returned each time the client polls the status of the
 * Wavemeter and the results. 
 * @author monroe-lab
 *
 */
public class WavemeterData implements IsSerializable
{
	/**
	 *  Array of the data of each individual Channel.
	 */
	public WavemeterChannelData[] ChannelData;

	/**
	 *  Temperature of the Wavemeter in degree Celsius
	 */
    public double Temperature;
    
    /**
     * Is Fast mode enabled
     */
    public boolean FastMode;
    /**
     * Is Wide mode enabled
     */
    public boolean WideMode;
    /**
     * Is switcher mode enabled
     */
    public boolean SwitcherMode;
    /**
     * Is pulsed mode enabled
     */
    public boolean PulseMode;
    /**
     * Is Regulation enabled (this should only be enabled if the builtin PID regulator
     * of the original software is used).
     */
    public boolean RegulationEnable;
    /**
     * Operation state of the wavemeter
     */
    public int Operation;
    /**
     * Currently active switcher channel
     */
    public int SwitcherChannel;
    /**
     *  Measurement set timestamp
     */
    public int SpinAroundTime;
    public int LastResultTime;
    public int CalibrationResultsSerial;
     
    public Vector<PatternData> PatternList;
    
    /**
     *  Initialization with the default Number of Channels.
     */
    public WavemeterData(int NumVirtChannels) {
    	ChannelData = new WavemeterChannelData[NumVirtChannels];
       	for (int i=0; i<NumVirtChannels; ++i)
       	 ChannelData[i] = new WavemeterChannelData();
    }
    
    public WavemeterData() {
    	ChannelData = new WavemeterChannelData[16];
    	for (int i=0; i<16; ++i)
    		ChannelData[i] = new WavemeterChannelData();
    }
}
